<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-title" content="Your title">
	<meta name="format-detection" content="telephone=no">
	<title>海棠金融四季度投资策略发布会</title>
	<link rel="stylesheet" href="css/index.css">
</head>
<body class="live">
	<div class="container">
		<img class="img logo" src="./img/logo.png" alt="logo">
		<img class="img title" src="./img/title.png" alt="title">
		
		<label class="code">		
			<input type="text" name="code" placeholder="请输入授权码">
		</label>

		<a class="btn" href="javascript:">登录</a>
	</div>

<script src="./pkgs/zepto/zepto.js"></script>
<script src="./pkgs/layer_mobile/layer.js"></script>
<script>
(function(){
	var windowH = $(window).height();

	$(window).resize(function(){
		var windowH1 = $(window).height();

		if (windowH > windowH1) {
			$(document.body).addClass('active');
		} else {
			$(document.body).removeClass('active');
		}
	});

	$(".btn").on("click", function(){
		var code = $("input").val();

		if (code.replace(/(^\s*)|(\s*$)/g, "") == "") {
			layer.open({
				content: "授权码不能为空",
				shadeClose: false,
				btn: "确定"
			});
		} else {
			$.ajax({
				type: "get",
				url: "http://api.ch-jht.com/live/index",
				data: {
					'code': code
				},
				dataType: "json",
				success: function(results){
					if (results.Success) {
						sessionStorage.setItem("access_token", true);
						location.href = "live.html";
					} else {
						layer.open({
							content: results.Msg,
							shadeClose: false,
							btn: "确定"
						});
					}
				}
			});
		}
	});
})();
</script>
</body>
</html>